home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / yelp / xslt / info2html.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2007-04-10  |  3.4 KB  |  124 lines

  1. <?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
  2.  
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.                 xmlns:yelp="http://www.gnome.org/yelp/ns"
  5.                 xmlns="http://www.w3.org/1999/xhtml"
  6.                 extension-element-prefixes="yelp"
  7.                 version="1.0">
  8.  
  9. <xsl:param name="stylesheet_path" select="''"/>
  10.  
  11. <xsl:param name="yelp.icon.blockquote"/>
  12. <xsl:param name="yelp.icon.caution"/>
  13. <xsl:param name="yelp.icon.important"/>
  14. <xsl:param name="yelp.icon.note"/>
  15. <xsl:param name="yelp.icon.programlisting"/>
  16. <xsl:param name="yelp.icon.tip"/>
  17. <xsl:param name="yelp.icon.warning"/>
  18.  
  19. <xsl:param name="yelp.color.fg"/>
  20. <xsl:param name="yelp.color.bg"/>
  21. <xsl:param name="yelp.color.anchor"/>
  22. <xsl:param name="yelp.color.rule"/>
  23. <xsl:param name="yelp.color.gray.fg"/>
  24. <xsl:param name="yelp.color.gray.bg"/>
  25. <xsl:param name="yelp.color.gray.bg.dark1"/>
  26. <xsl:param name="yelp.color.gray.bg.dark2"/>
  27. <xsl:param name="yelp.color.gray.bg.dark3"/>
  28. <xsl:param name="yelp.color.selected.fg"/>
  29. <xsl:param name="yelp.color.selected.bg"/>
  30. <xsl:param name="yelp.color.selected.bg.dark1"/>
  31. <xsl:param name="yelp.color.selected.bg.dark2"/>
  32. <xsl:param name="yelp.color.selected.bg.dark3"/>
  33. <xsl:param name="yelp.color.admon.fg"/>
  34. <xsl:param name="yelp.color.admon.bg"/>
  35. <xsl:param name="yelp.color.admon.bg.dark1"/>
  36. <xsl:param name="yelp.color.admon.bg.dark2"/>
  37. <xsl:param name="yelp.color.admon.bg.dark3"/>
  38.  
  39. <xsl:template match="/Info">
  40.   <xsl:apply-templates select="Section"/>
  41. </xsl:template>
  42.  
  43. <xsl:template match="Section">
  44.   <yelp:document href="{@id}">
  45.     <html>
  46.       <head>
  47.         <title>
  48.           <xsl:value-of select="@name"/>
  49.         </title>
  50.         <style type="text/css">
  51.           <xsl:call-template name="html.css"/>
  52.         </style>
  53.       </head>
  54.       <body>
  55.         <pre class="body">
  56.           <xsl:apply-templates select="node()[not(self::Section)]"/>
  57.         </pre>
  58.       </body>
  59.     </html>
  60.   </yelp:document>
  61.   <xsl:apply-templates select="Section"/>
  62. </xsl:template>
  63.  
  64. <xsl:template match="para">
  65.   <xsl:value-of select="node()"/>
  66.   <xsl:text>
  67.   </xsl:text>
  68. </xsl:template>
  69.  
  70. <xsl:template match="para1">
  71.   <xsl:value-of select="node()"/>
  72. </xsl:template>
  73.  
  74. <xsl:template match="spacing">
  75.   <xsl:value-of select="node()"/>
  76. </xsl:template>
  77.  
  78. <xsl:template match="a">
  79.   <xsl:element name="a">
  80.     <xsl:attribute name="href"> <xsl:value-of select="@href"/></xsl:attribute>
  81.     <xsl:value-of select="node()"/>
  82.   </xsl:element>
  83. </xsl:template>
  84.  
  85. <xsl:template match="menuholder">
  86.   <xsl:apply-templates select="node()[not(self::menuholder)]"/>
  87. </xsl:template>
  88.  
  89. <xsl:template match="noteholder">
  90.   <xsl:apply-templates select="node()[not(self::noteholder)]"/>
  91. </xsl:template>
  92.  
  93. <xsl:template name="html.css"><xsl:text>
  94. h1 { font-size: 1.6em; font-weight: bold; }
  95. h2 { font-size: 1.4em; font-weight: bold; }
  96. h3 { font-size: 1.2em; font-weight: bold; }
  97.  
  98. h1, h2, h3, h4, h5, h6, h7 { color: </xsl:text>
  99. <xsl:value-of select="$yelp.color.gray.fg"/><xsl:text>; }
  100.  
  101. body { margin: 0em; padding: 0em; }
  102. pre[class~="body"] {
  103. margin-left: 0.8em;
  104. margin-right: 0.8em;
  105. margin-bottom: 1.6em;
  106. }
  107.  
  108. p, div { margin: 0em; }
  109. p + *, div + * { margin-top: 1em; }
  110.  
  111. dl { margin: 0em; }
  112. dl dd + dt { margin-top: 1em; }
  113. dl dd {
  114.   margin-top: 0.5em;
  115.   margin-left: 2em;
  116.   margin-right: 1em;
  117. }
  118. ol { margin-left: 2em; }
  119. ul { margin-left: 2em; }
  120. ul li { margin-right: 1em; }
  121. </xsl:text></xsl:template>
  122.  
  123. </xsl:stylesheet>
  124.